package cn.ldh.feignclient;


import cn.ldh.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;


@Component
public class UserFallback implements FallbackFactory<UserFeignclient> {


    @Override
    public UserFeignclient create(Throwable throwable) {
        return new UserFeignclient() {
            @Override
            public User getById(Long id) {
                return new User(-1L,"熔断了","服务不能进行");
            }
        };
    }
}
